﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;

namespace WordSmith_V1.Library.Model
{
    public class Book
    {
        public Book() {
            Chapters = new Collection<Chapter>();
            Authors = new Collection<User>();
        }
        public virtual int BookId { get; set; }

        //decided not to use virtual here ; to prevent EF from creating proxy and causing issue
        //http://stackoverflow.com/questions/3858922/code-first-adding-to-collections-how-to-use-code-first-with-repositories
        public  ICollection<Chapter> Chapters { get; set; }
        public  ICollection<User> Authors { get; set; }
        public virtual string Title { get; set; }
        public virtual string Image { get; set; }
        public virtual int GenreId { get; set; }
        //TODO add Genre
        //public Genre Genre { get; set; }

        
    }
}
